const TabbarReducer = (preState = { showBar: true }, action = {}) => {
  const state = { ...preState };
  const { type } = action;
  switch (type) {
    case 'hide-tabbar':
      state.showBar = false;
      return state;
    case 'show-tabbar':
      state.showBar = true;
      return state;
    default:
      return preState;
  }
};

export default TabbarReducer;
